using UnityEngine;
using System.Collections;

public class UIBar : UISeg
{
	public CanComponent canComponent;
	
	override protected void initComponent ()
	{
		base.initComponent ();
		setTabComponentIndex ();
	}
	
	override public bool setActiveComponentIndex (int componentIndex)
	{
		if (base.setActiveComponentIndex (componentIndex)) {
			setTabComponentIndex ();
			return true;
		}
		
		return false;
	}
	
	virtual protected void setTabComponentIndex ()
	{
		if (canComponent != null) {
			canComponent.setActiveComponentIndex (activeComponentIndex);
		}
	}
	
}
